﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BingoServerCommon.Common;
using System.Threading;

namespace BingoGameServerConsole
{
    public class User :BasePlayer
    {
        public IntPtr connId;
        public long id;
        public string name;
        public string icon;
        public bool bRobot = false;//是否是机器人

        private long curWorkId =-1;
        private long curRoomId =-1;

        public int selectCardNum = -1;//用户选择的卡片数量
        public int selectMult = 1;//用户选择的倍数

        public User(long _id,IntPtr cid)
        {
            id = _id;
            connId = cid;
        }
        public void Reset()
        {
            selectCardNum = -1;
            selectMult = 1;
        }
        public void ChangeWorkId(int value)
        {
            Interlocked.Exchange(ref curWorkId, value);
        }
        public void ChangeRoomId(int value)
        {
            Interlocked.Exchange(ref curRoomId, value);
        }
        public long GetWorkId()
        {
            long value=Interlocked.Read(ref curWorkId);
            return value;
        }
        public long GetRoomId()
        {
            long value = Interlocked.Read(ref curRoomId);
            return value;
        }

    }
}
